﻿<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->

<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
  xmlns:layoutPrimitivesToolkit="clr-namespace:System.Windows.Controls.Primitives"
  xmlns:layoutToolkit="clr-namespace:System.Windows.Controls">
  <Style TargetType="layoutToolkit:AccordionItem">
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="BorderBrush" Value="#FFECECEC" />
    <Setter Property="Background" Value="White"/>
    <Setter Property="Margin" Value="0" />
    <Setter Property="Padding" Value="0" />
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Stretch"/>
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="VerticalContentAlignment" Value="Top"/>
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="layoutToolkit:AccordionItem">
        <Grid Background="{TemplateBinding Background}" 
				HorizontalAlignment="{TemplateBinding HorizontalAlignment}" 
				VerticalAlignment="{TemplateBinding VerticalAlignment}">
          <vsm:VisualStateManager.VisualStateGroups>
              <!-- CommonState -->
              <vsm:VisualStateGroup x:Name="CommonStates">
                  <vsm:VisualStateGroup.Transitions>
                      <vsm:VisualTransition GeneratedDuration="0"/>
                  </vsm:VisualStateGroup.Transitions>
                  <vsm:VisualState x:Name="Normal"/>
                  <vsm:VisualState x:Name="Pressed"/>
                  <vsm:VisualState x:Name="MouseOver"/>
                  <vsm:VisualState x:Name="Disabled" />
              </vsm:VisualStateGroup>
              <!-- FocusStates -->
              <vsm:VisualStateGroup x:Name="FocusStates">
                <vsm:VisualState x:Name="Focused" />
                <vsm:VisualState x:Name="Unfocused"/>
              </vsm:VisualStateGroup>
              <!-- ExpansionStates -->
              <vsm:VisualStateGroup x:Name="ExpansionStates">
                  <vsm:VisualStateGroup.Transitions>
                      <vsm:VisualTransition GeneratedDuration="0"/>
                  </vsm:VisualStateGroup.Transitions>
                  <vsm:VisualState x:Name="Collapsed">
                      <Storyboard>
                    <DoubleAnimationUsingKeyFrames
                      BeginTime="00:00:00"
                      Storyboard.TargetName="ExpandSite"
                      Storyboard.TargetProperty="(ExpandableContentControl.Percentage)">
                      <SplineDoubleKeyFrame
                        KeyTime="00:00:00.3"
                        KeySpline="0.2,0,0,1"
                        Value="0" />
                    </DoubleAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames
                      BeginTime="00:00:00.3"
                      Duration="00:00:00"
                      Storyboard.TargetName="ExpandSite"
                      Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame
                        KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                      </Storyboard>
                  </vsm:VisualState>
                  <vsm:VisualState x:Name="Expanded">
                      <Storyboard>
                          <DoubleAnimationUsingKeyFrames
							  BeginTime="00:00:00"
							  Storyboard.TargetName="ExpandSite"
							  Storyboard.TargetProperty="(ExpandableContentControl.Percentage)">
                              <SplineDoubleKeyFrame
								  KeyTime="00:00:00.3"
								  KeySpline="0.2,0,0,1"
								  Value="1" />
                          </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                  </vsm:VisualState>
              </vsm:VisualStateGroup>
              <!-- ExpansionStates -->
              <vsm:VisualStateGroup x:Name="LockedStates">
                  <vsm:VisualStateGroup.Transitions>
                      <vsm:VisualTransition GeneratedDuration="0"/>
                  </vsm:VisualStateGroup.Transitions>
                  <vsm:VisualState x:Name="Locked">
                      <Storyboard>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="IsEnabled">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="False"/>
                          </ObjectAnimationUsingKeyFrames>
                      </Storyboard>
                  </vsm:VisualState>
                  <vsm:VisualState x:Name="Unlocked">
                      <Storyboard>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="IsEnabled">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="True"/>
                          </ObjectAnimationUsingKeyFrames>
                      </Storyboard>
                  </vsm:VisualState>
              </vsm:VisualStateGroup>
              <!-- ExpandDirectionStates-->
              <vsm:VisualStateGroup x:Name="ExpandDirectionStates">
                  <vsm:VisualStateGroup.Transitions>
                      <vsm:VisualTransition GeneratedDuration="0"/>
                  </vsm:VisualStateGroup.Transitions>
                  <vsm:VisualState x:Name="ExpandDown">
                      <Storyboard>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd1" Storyboard.TargetProperty="Height">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                          </ObjectAnimationUsingKeyFrames>
                      </Storyboard>
                  </vsm:VisualState>
                  <vsm:VisualState x:Name="ExpandUp">
                      <Storyboard>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Row)">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                          </ObjectAnimationUsingKeyFrames>
                      </Storyboard>
                  </vsm:VisualState>
                  <vsm:VisualState x:Name="ExpandLeft">
                      <Storyboard>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.ColumnSpan)">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.ColumnSpan)">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.RowSpan)">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="2"/>
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.RowSpan)">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="2"/>
                          </ObjectAnimationUsingKeyFrames>

                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.Column)">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd0" Storyboard.TargetProperty="Width">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                          </ObjectAnimationUsingKeyFrames>
                      </Storyboard>
                  </vsm:VisualState>
                  <vsm:VisualState x:Name="ExpandRight">
                      <Storyboard>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.ColumnSpan)">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.ColumnSpan)">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(Grid.RowSpan)">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="2"/>
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.RowSpan)">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="2"/>
                          </ObjectAnimationUsingKeyFrames>

                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Row)">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(Grid.Column)">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="rd0" Storyboard.TargetProperty="Height">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="cd1" Storyboard.TargetProperty="Width">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
                          </ObjectAnimationUsingKeyFrames>
                      </Storyboard>
                  </vsm:VisualState>
              </vsm:VisualStateGroup>
          </vsm:VisualStateManager.VisualStateGroups>
          <Border x:Name="Background" 
			      Padding="{TemplateBinding Padding}" 
			      BorderBrush="{TemplateBinding BorderBrush}" 
			      BorderThickness="{TemplateBinding BorderThickness}" 
			      CornerRadius="1,1,1,1">
              <Grid>
                  <Grid.RowDefinitions>
                      <RowDefinition Height="Auto" x:Name="rd0"/>
                      <RowDefinition Height="Auto" x:Name="rd1"/>
                  </Grid.RowDefinitions>
                  <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="Auto" x:Name="cd0"/>
                      <ColumnDefinition Width="Auto" x:Name="cd1"/>
                  </Grid.ColumnDefinitions>

                  <layoutPrimitivesToolkit:AccordionButton
					          x:Name="ExpanderButton"
                    Style="{TemplateBinding AccordionButtonStyle}"
					          Content="{TemplateBinding Header}"
					          ContentTemplate="{TemplateBinding HeaderTemplate}"
					          IsChecked="{TemplateBinding IsSelected}"
					          IsTabStop="True"
					          Grid.Row="0"
					          Padding="0,0,0,0"
					          Margin="0,0,0,0"
					          FontFamily="{TemplateBinding FontFamily}"
					          FontSize="{TemplateBinding FontSize}"
					          FontStretch="{TemplateBinding FontStretch}"
					          FontStyle="{TemplateBinding FontStyle}"
					          FontWeight="{TemplateBinding FontWeight}"
					          Foreground="{TemplateBinding Foreground}"
                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                    HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                    VerticalAlignment="{TemplateBinding VerticalAlignment}" 
                    Background="{TemplateBinding Background}" />
                  <layoutPrimitivesToolkit:ExpandableContentControl
					          x:Name="ExpandSite"
					          Grid.Row="1"
					          IsTabStop="False"
					          Percentage="0"
                    RevealMode="{TemplateBinding ExpandDirection}"
					          Content="{TemplateBinding Content}"
					          ContentTemplate="{TemplateBinding ContentTemplate}"
					          Margin="0,0,0,0"
                    Style="{TemplateBinding ExpandableContentControlStyle}"
					          FontFamily="{TemplateBinding FontFamily}"
					          FontSize="{TemplateBinding FontSize}"
					          FontStretch="{TemplateBinding FontStretch}"
					          FontStyle="{TemplateBinding FontStyle}"
					          FontWeight="{TemplateBinding FontWeight}"
					          Foreground="{TemplateBinding Foreground}"
					          HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
					          VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" 
					          HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
					          VerticalAlignment="{TemplateBinding VerticalAlignment}"/>
              </Grid>
          </Border>
        </Grid>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>
</ResourceDictionary>
